package emailbeans;

import java.io.IOException;

import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;

public class LogOutBean {

	/**
	 * This method invalidate the httpSession andr redirect to employeeAuthentication
	 */
	public void logOut(){
		
		FacesContext facesContext = FacesContext.getCurrentInstance();
		  HttpSession httpSession = (HttpSession)facesContext.getExternalContext().getSession(false);
		  httpSession.invalidate();	    

  	  try {
				FacesContext
						.getCurrentInstance()
						.getExternalContext()
						.redirect("/MSGCandidateTesting/faces/employeeAuthentification.xhtml");
			} catch (IOException e) {
				e.printStackTrace();
			}
	}
}
